﻿using Hidistro.Membership.Context;
using Hidistro.Membership.Core.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Hidistro.UI.SaleSystem.Tags
{
    public class wnxd_VShop_User : WebControl
    {
        protected override void Render(HtmlTextWriter writer)
        {
            writer.Write(this.RendHtml());
        }
        private string RendHtml()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<ul>");
            if (HiContext.Current.User.UserRole == UserRole.Member)
            {
                sb.Append("<li><a href=\"/Vshop/MemberCenter.aspx\">用户中心</a></li>");
                sb.Append("<li><a href=\"/Logout.aspx\">退出</a></li>");
            }
            else
            {
                sb.Append("<li><a href=\"/Vshop/Login.aspx\">登录</a></li>");
                sb.Append("<li><a href=\"/Vshop/Login.aspx\">注册</a></li>");
            }
            sb.Append("<li><a href=\"#top\">返回顶部</a></li>");
            sb.Append("</ul>");
            return sb.ToString();
        }
    }
}
